package com.lcq.springbootcreate.project.dao;

import com.lcq.springbootcreate.project.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class UserDao implements UserMapper {
    @Autowired
    UserMapper userMapper;

    @Override
    public User getUserById(int id) {
        return userMapper.getUserById(id);
    }

    @Override
    public User getUserByName(String username) {
        return userMapper.getUserByName(username);
    }

    @Override
    public int insertByUser(User user) {
        return userMapper.insertByUser(user);
    }

    @Override
    public int updateSignatureByUserId(User user) {
        System.out.println("开始执行sql更新操作");
        return userMapper.updateSignatureByUserId(user);
    }

    @Override
    public List<User> getAll() {
        return userMapper.getAll();
    }
}
